package com.netease.nim.uikit.business.session.viewholder;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.netease.nim.uikit.R;

/**
 * @author hdx on 2019/2/27.
 */
public class ZoomPicAcitivity extends Activity {
    ImageViewTouch ziv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_zoom_image);
        ziv = findViewById(R.id.ziv);
        String uri = getIntent().getStringExtra("uri");
        int rotate = getIntent().getIntExtra("rotate", 0);
        // ziv.setImageBitmap(ShareBitmap.getInstance().getBitmap());
        RequestOptions options = new RequestOptions()
                .fitCenter()
                .placeholder(com.netease.nim.uikit.R.drawable.nim_image_default)
                .error(com.netease.nim.uikit.R.drawable.nim_image_default);
        if (rotate == 1) {
            Glide.with(this).load(uri)
                    .apply(options)
                    .into(ziv);
        } else {
            Glide.with(this).load(uri)
                    .apply(options)
                    .into(ziv);

        }

        /*ziv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              // ZoomPicAcitivity.this.finish();
            }
        });*/
    }
}
